<%--
  Created by IntelliJ IDEA.
  User: 东方九夜
  Date: 2021/6/17
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ page import="bean.*" %>
<%@ page import="dao.*" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>修改信息界面</title>
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<%
    Customer c = (Customer) request.getSession().getAttribute("teacher");
    if(c == null){
        response.sendRedirect("Not_Login.jsp");
    }
%>
<div class="main">
    <div class="navigation">
				<span>欢迎回来!
					<%
                        if(c != null){
                            out.print(c.getName());
                        }
                    %>
					教师
				</span>
        <a class="exit" href="index.jsp"><span>退出登录</span></a>
    </div>
    <table class="table" style="margin:0 auto;width:90%">
        <tr>
            <td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='index_Teacher.jsp'">公告</button>	</td>
            <td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Student_Data.jsp'">毕设相关</button></td>
            <td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Manage_Grades.jsp'">成绩录入</button></td>
        </tr>
    </table>
    <div>
        <%
            String ID = request.getParameter("ID");
            Customer customer = TeacherSql.getCustomerByID(ID);
        %>
        <form  method="post" action="AlterInfoServlet">
            <table class="table table-hover; table_center" style="margin:0 auto;width:90%">
                <td>编号:<%=customer.getId() %></td>
                <td>编号:<%=customer.getName() %></td>
                <td>
                    <div>
                        <label>性别: </label>
                        <select name="Sex">
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </div>
                    <input type="hidden" name="ID" value="<%=ID %>" />
                    <input type="hidden" name="Type" value="<%=customer.getType() %>" />
                </td>
                <td>
                    <div class="form-group">
                        <label >Email</label>
                        <input type="text" name="Email" value="<%=customer.getEmail()%>"/>
                    </div>
                </td>
                <td>
                    <div class="form-group">
                        <label>电话</label>
                        <input type="text" name="Phone" value="<%=customer.getPhone()%>"/>
                    </div>
                </td>
                <td>
                    <button type="submit" class="btn btn-default btn-sm" >提交</button>
                </td>
            </table>
        </form>
    </div>
    <div class="clear"></div>
</div>

</body>
</html>
